-
Notifications
You must be signed in to change notification settings - Fork 67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: set-namespace without kyaml/rnode dependencies #769
feat: set-namespace without kyaml/rnode dependencies #769
Conversation
faf138b
to
02329db
Compare
1bbbcb0
to
7a862ab
Compare
216052f
to
696ba29
Compare
30b96e0
to
c115f50
Compare
var subjects []*Subject | ||
o.GetOrDie(&subjects, "subjects") | ||
for _, s := range subjects { | ||
if s.Name == "default" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed in this doc, there are 2 scenarios to update the namespace field:
- subject is a ServiceAccount and its name is "default"
- subject is a ServiceAccount and its name is not "default", but there is a ServiceAccount object that has the matching name.
It's a superset of what you currently have.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, do you mind me making the change in the following PR. I have some other logic relevant to this need to add as well. Basically, the new set-namespace only expect a single namespace exists. It raises error if multiple namespace is detected. Thus, here the namespace will be updated if and only if it is a ServiceAccount kind and the existing namespace matches the found one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm OK with doing this logic in a followup PR.
701d255
to
6efd22e
Compare
7c18805
to
6efd22e
Compare
The e2e CI is failing since we need the change in https://github.com/GoogleContainerTools/kpt-functions-catalog/pull/778/files#diff-ffb14a1d95b60197845214f7c645cfb58afc4d1de90eb37587be970ebe7c6f57R8 to make it passing. |
@yuwenma you can rebase this PR, it should be passing after that. |
062d7d0
to
01efe36
Compare
This function re-implements the set-namespace function but removes all kyaml dependencies.
It's not ready to be merged until its dependent functions are merged in kpt-functions-sdk